home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.std.c
- Subject: Is a diagnostic required?
- Date: 22 Feb 96 14:35:40 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.824999740@rscernix>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- Hi,
-
- Does the following code require a diagnostic?
-
- foo()
- {
- }
-
- main()
- {
- foo(3);
- }
-
- I was always convinced that there is no difference between foo() and
- foo(void) in the _definition_ of the function foo and that 'void' as the
- argument list of a function was introduced for function declarations,
- because an empty argument list in a function declaration had to be
- treated as in K&R C. Yet, all the compilers I tried accepted this code
- without complaint and complained when 'void' was introduced in the
- definition of foo.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-